import request from '@/utils/request'

// 查询采集配置列表
export function listDiySpider(query) {
  return request({
    url: '/article/diySpider/list',
    method: 'get',
    params: query
  })
}

// 查询采集配置详细
export function getDiySpider(id) {
  return request({
    url: '/article/diySpider/' + id,
    method: 'get'
  })
}

// 新增采集配置
export function addDiySpider(data) {
  return request({
    url: '/article/diySpider',
    method: 'post',
    data: data
  })
}

// 修改采集配置
export function updateDiySpider(data) {
  return request({
    url: '/article/diySpider',
    method: 'put',
    data: data
  })
}

// 删除采集配置
export function delDiySpider(id) {
  return request({
    url: '/article/diySpider/' + id,
    method: 'delete'
  })

}
  // 查询采集来源
  export function spiderItemSelect() {
    return request({
      url: '/article/diySpider/getSpiderItem',
      method: 'get'
    })
  }

    // 查询采集分类
    export function spiderClassSelect() {
      return request({
        url: '/article/diySpider/getSpiderClassTreeData',
        method: 'get'
      })
    }

// 查询生成模型
export function PromptsSelect() {
  return request({
    url: '/article/diySpider/getPromptsItem',
    method: 'get'
  })
}

      // 执行采集任务
      export function toSpider(id) {
        return request({
          url: '/article/diySpider/spiderStart/'+ id,

          method: 'get'
        })
      }
